import requestUtils from '../../index'
import { IDataType } from '../../type'

enum ChartsUrl {
  CATEGORY_GOODS_COUNT = '/goods/category/count',
  CATEGORY_GOODS_SALE = '/goods/category/sale',
  CATEGORY_GOODS_FAVOR = '/goods/category/favor',
  ADDRESS_GOODS_SALE = '/goods/address/sale',
  GOODS_AMOUNT_LIST = '/goods/amount/list',
  GOODS_SALE_TOP10 = '/goods/sale/top10'
}

export function getCategoryGoodsCount() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.CATEGORY_GOODS_COUNT
  })
}
export function getCategoryGoodsSale() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.CATEGORY_GOODS_SALE
  })
}
export function getCategoryGoodsFavor() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.CATEGORY_GOODS_FAVOR
  })
}
export function getAddressGoodsSale() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.ADDRESS_GOODS_SALE
  })
}

export function getGoodsAmountList() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.GOODS_AMOUNT_LIST
  })
}

export function getGoodsSaleTop10() {
  return requestUtils.get<IDataType>({
    url: ChartsUrl.GOODS_SALE_TOP10
  })
}
